package com.mxpio.erp.common.technology.entity;

import com.mxpio.erp.common.jpa.policy.ResCodeGeneratorPolicy;
import com.mxpioframework.filestorage.entity.MxpioFileInfo;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_TECHNOLOGY_PROD_ROUT_PROC_DRAWING_SIGN_IN")
@Schema(description="产品工艺路线明细(工序)工艺图纸 签入")
public class ProdTecRoutProcTechDrawingSignIn extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "CODE_")
	@Schema(description = "申请单号")
	@Generator(policy = ResCodeGeneratorPolicy.class)
	private String code;

	@Column(name = "ROUT_PROC_ID_")
	@Schema(description = "产品工艺路线明细(工序)ID")//展示数据用
	private String routProcId;

	@Column(name = "ITEM_CODE_")
	@Schema(description = "产品(物料)编码")//展示数据用
	private String itemCode;

	@Column(name = "FALIMY_",updatable = false)
	@Schema(description = "文件家族标志")
	private String family;

	@Column(name = "DRAWING_FILE_ID_")
	@Schema(description = "工艺图纸ID主键")//ProdTecRoutProcTechDrawing的id
	private String drawingFileId;

	@Column(name = "SIGN_IN_DESC_")
	@Schema(description = "签入说明")
	private String signInDesc;

	@Column(name = "PROCESS_INSTANCE_ID_")
	@Schema(description = "流程实例ID")
	private String processInstanceId;

	@Column(name = "BPMN_STATUS_")
	@Schema(description = "审核状态")
	@Dict(dicCode = "ERP_COMMON_BPMN_STATUS")
	private String bpmnStatus;

	/*@Column(name = "EFFECTIVE_TIME_")
	@Schema(description = "生效时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date effectiveTime;*/

	//接收签入内容
	@Column(name = "FILE_NO_")
	@Schema(description = "附件")
	@Dict(dicCode = "fileNo", dicEntity = MxpioFileInfo.class, dicText = "fileName")
	private String fileNo;

	@Column(name = "FILE_NAME_")
	@Schema(description = "文件名称")
	private String fileName;

	@Column(name = "LENGTH_")
	@Schema(description = "文件大小")
	private long length;

	@Column(name = "REMARKS_")
	@Schema(description = "文件描述")
	private String remarks;

	@Column(name = "EXTENSION_")
	@Schema(description = "文件扩展名")
	private String extension;

	@Transient
	private ProdTecRoutProc proc;
	@Transient
	private Item item;

}
